function remainingDays() {
  return (time) => {
    /*eslint-disable */
    if (time) {
      time = parseInt(time);
      const remainingTime = time - new Date().getTime();
      let days = parseInt(remainingTime / (1000 * 60 * 60 * 24));
      days = days < 0 ? 0 : days;
      return days;
    }
    return '';
  };
}

export default remainingDays;
